-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Nanosoldier to Julia 0.6 and JSON benchmarks #38
Conversation
REQUIRE
Outdated
@@ -1,7 +1,6 @@ | |||
julia 0.4 | |||
julia 0.6 | |||
BenchmarkTools 0.0.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't BenchmarkTools be also updated with the new minimum after it's tagged of course
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It isn't tagged yet.
Is this the case? I think what was being saved/loaded from the JLD file is a It's been a while, though...I could be misremembering 😛 |
3ac1e2b
to
27c41b5
Compare
I added a commit that turns on precompilation but had to revert it because apparently GitHub.jl doesn't support it. I can try again (perhaps in a separate PR, depending on how long this is open) after JuliaWeb/GitHub.jl#93 is merged and tagged. |
src/jobs/BenchmarkJob.jl
Outdated
loaded = BenchmarkTools.load(benchresults)[2] | ||
ind = findfirst(x->isa(x, BenchmarkTools.BenchmarkGroup), loaded) | ||
@assert ind > 0 | ||
results = loaded[ind] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you walk me through this? I had thought that BenchmarkTools.load(benchresults)
would return results::BenchmarkGroup
directly, since that what was saved via BenchmarkTools.save
earlier. I'm probably misremembering something...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the JSON format, save
writes
[{"Julia":"x.y.z","BenchmarkTools":"0.2.0"},[["BenchmarkTools.BenchmarkGroup",{"tags":[...],"data":{...}}]]]
Then load
makes this
[Dict("Julia"=>"x.y.z", "BenchmarkTools"=>"0.2.0"), [BenchmarkGroup(...)]]
That is, the result is a two-element array where the first is the version information and the second is an array of the deserialized values.
loaded = BenchmarkTools.load(benchresults)[2] # gets the vector of values
ind = findfirst(x->isa(x, BenchmarkGroup), loaded) # figure out which of the elements is a BenchmarkGroup
@assert ind > 0 # make sure one of them is
results = loaded[ind] # retrieve the BenchmarkGroup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. At some point in the future, we should change load
to just return the second element, without the version info Dict
. AFAICT there's no reason for load
to expose version info to the caller. My bad, I should've caught this when reviewing JuliaCI/BenchmarkTools.jl#79. Let's ignore it for now, though, for poor Nanosoldier's sake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd might as well make that change now before too many packages start depending on the current behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah I'm just an idiot, this is already how it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...well that was the easiest API patch ever 😛
@@ -336,7 +336,7 @@ function execute_benchmarks!(job::BenchmarkJob, whichbuild::Symbol) | |||
results = run(benchmarks; verbose = true) | |||
|
|||
println("SAVING RESULT...") | |||
BenchmarkTools.save(\"$(benchresults)\", "results", results) | |||
BenchmarkTools.save(\"$(benchresults)\", results) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The benchresults
filename extension needs to be changed from .jld
to .json
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😱
No reason not to enable precompilation here, but it wouldn't actually matter, right? IIRC the server should only ever be launched with |
I believe so, which is why I wanted to experiment with precompilation. |
27c41b5
to
5fd2c49
Compare
Bump. How are we doing here? |
So far so good. BaseBenchmarks needs to be updated, and I'm working on that, then I'll need to do some testing on Nanosoldier. This is at the top of my priority list. |
5fd2c49
to
af083d0
Compare
@@ -3,7 +3,7 @@ language: julia | |||
os: | |||
- linux | |||
julia: | |||
- release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 0.6
should be added here in place of release
, yeah?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably
abb4f44
to
9e3ea12
Compare
In #38, `NanosoldierError` was mistakenly changed from being declared as `type` to `struct`. The object is constructed piecemeal in the benchmark job code, so the type needs to be mutable.
In order to use the fancy new BenchmarkTools JSON-based serialization, we also need to update the Nanosoldier to use Julia 0.6.
I'm not intimately familiar with this code but the fact that benchmarks are loaded from JLD files as a
Dict
seems to be a pretty deep-seated assumption, so that will be a challenge to unravel completely.